home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / server1.zip / _INIT.QC < prev    next >
Text File  |  1996-09-04  |  2KB  |  73 lines

  1. /*
  2. **
  3. ** _init.qc (Init Code, 1.0)
  4. **
  5. ** Copyright (C) 1996 Johannes Plass
  6. ** 
  7. ** This program is free software; you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation; either version 2 of the License, or
  10. ** (at your option) any later version.
  11. ** 
  12. ** This program is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with this program; if not, write to the Free Software
  19. ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ** 
  21. ** Author:   Johannes Plass (plass@dipmza.physik.uni-mainz.de)
  22. **
  23. */
  24.  
  25. void(entity player) InitInfo =
  26. {
  27.    if (!USE_MODULE_INIT) return;
  28.    // nothing to do here
  29. };
  30.  
  31. void(entity player) InitInit =
  32. {
  33.    if (!USE_MODULE_INIT) return;
  34.    stuffcmd(player,"alias init-nextcall \"impulse 208\";\n");
  35.    stuffcmd(player,"alias init-nextskin \"impulse 209\";\n");
  36. };
  37.  
  38. float(entity player) InitCallIsPermitted =
  39. {
  40.    if (!USE_MODULE_INIT) {
  41.         //           123456789#123456789#123456789#12345678
  42.       sprint(player,"init: error: init calls are not\n");
  43.       sprint(player,"      allowed on this server.\n");
  44.       return(0);
  45.    }
  46.    if (player.player_status & PLAYER_PASSED_INIT_PHASE) {
  47.       sprint(player,"init: error: can execute init calls\n");
  48.       sprint(player,"      only during initialization.\n");
  49.       return(0);
  50.    }
  51.    player.init_calls_executed = player.init_calls_executed + 1;
  52.    if (player.init_calls_executed > 40) {
  53.       sprint(player,"init: error: cannot execute more\n");
  54.       sprint(player,"      than 40 init-calls.\n");
  55.       return(0);
  56.    }
  57.    return(1);
  58. };
  59.  
  60. void(entity player) InitLetClientExecInit =
  61. {
  62.    if (!USE_MODULE_INIT) return;
  63.  
  64.    sprint(player,"Trying to execute command 'init'\n");
  65.    stuffcmd(player,"init;\n");
  66. };
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.